from django.template import Library

from event.models import Schedule, Session

register = Library()

@register.inclusion_tag("event/table/sessions.html")
def list_all_sessions():
    return {'session_list': Session.objects.all()}

@register.inclusion_tag("event/table/schedule.html")
def list_schedule(session_object):
    schedule = Schedule.objects.filter(session = session_object)
    return {'schedule_list': schedule}
